<template>
	<!-- 搜索框区域 -->
	<view class="my-search-container" :style="{ 'background-color': bgcolor }">
		<view class="my-search-box" :style="{ 'border-radius': radius + 'px' }" @click="gotoSearch">
			<!-- 使用 uni-ui 提供的图标组件 -->
			<uni-icons type="search" size="17"></uni-icons>
			<text class="placeholder">搜索</text>
		</view>
		<view class="my-search-box-right" @click="gotoPost">
				<uni-icons type="plusempty" size="25"></uni-icons>
		</view>
	</view>

</template>

<script>
	export default {
		props: {
			// 背景颜色
			bgcolor: {
				type: String,
				default: '#ffffff'
			},
			// 圆角尺寸
			radius: {
				type: Number,
				default: 18 // px
			}
		},
		data() {
			return {

			}
		},
		methods: {

			// searchBoxHandler() {
			// 	this.$emit('click')
			// },
			gotoSearch() {
				console.log("你爸爸")
				uni.navigateTo({
					url: '/subpkg/search/search'
				})
			},
			gotoPost() {
				console.log("我草");
				uni.navigateTo({
					url: '/subpkg/post/post'
				})
			}
		}
	}
</script>

<style lang="scss">
	.my-search-container {
		height: 50px;
		// background-color: #d6d6d6;
		display: flex;
		align-items: center;
		padding: 0 10px;

		.my-search-box {
			height: 36px;
			background-color: #d6d6d6;
			// border-radius: 18px;
			width: 90%;
			display: flex;
			justify-content: center;
			align-items: center;

			.placeholder {
				font-size: 15px;
				margin-left: 5px;
			}
		}

		.my-search-box-right {
			// background-color: red;
			margin-left: 20rpx;
			// // height: 36px;
			// width: 10%;
			// align-items: center;
			// justify-content: center;
		}
	}
</style>